package com.moioo.exam;

/**
 * TExamPaperUserId entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class TExamPaperUserId implements java.io.Serializable {
	private static final long serialVersionUID = 5377575076773526637L;
	private Integer parperid;
	private String papssport;
	private TUser user;
	
	// Constructors

	/** default constructor */
	public TExamPaperUserId() {
	}

	/** full constructor */
	public TExamPaperUserId(Integer parperid, String papssport) {
		this.parperid = parperid;
		this.papssport = papssport;
	}

	// Property accessors

	public Integer getParperid() {
		return this.parperid;
	}

	public void setParperid(Integer parperid) {
		this.parperid = parperid;
	}

	public String getPapssport() {
		return this.papssport;
	}

	public void setPapssport(String papssport) {
		this.papssport = papssport;
	}
	public String getUserName(){
		try{
			if (this.user==null)this.user=TUser.get(this.papssport);
			return this.user.getName();}catch(Exception e){}
		return this.papssport;
	}
	public String getorganNameHtml()
	{
		try{
			if (this.user==null)this.user=TUser.get(this.papssport);
			return this.user.getOrganNameHtml();}catch(Exception e){}
		return "";		
	}
	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TExamPaperUserId))
			return false;
		TExamPaperUserId castOther = (TExamPaperUserId) other;

		return ((this.getParperid() == castOther.getParperid()) || (this
				.getParperid() != null
				&& castOther.getParperid() != null && this.getParperid()
				.equals(castOther.getParperid())))
				&& ((this.getPapssport() == castOther.getPapssport()) || (this
						.getPapssport() != null
						&& castOther.getPapssport() != null && this
						.getPapssport().equals(castOther.getPapssport())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getParperid() == null ? 0 : this.getParperid().hashCode());
		result = 37 * result
				+ (getPapssport() == null ? 0 : this.getPapssport().hashCode());
		return result;
	}

}